/*
 * Block.cpp
 *
 *  Created on: May 31, 2011
 *      Author: hongyang
 */

#include "Block.h"

int Block::alloc_blocks = 0;

Block::Block() :
	id(++alloc_blocks), deleted(false) {
}

Block::Block(const Block& b) :
	player(b.player), anchor(b.anchor), id(b.id) {
	Util::copy(points, b.points);
	Util::copy(set, b.set);
	Util::copy(liberties, b.liberties);
}

void Block::copy(const Block& b) {
	deleted = false;
	player = b.player;
	anchor = b.anchor;
	id = b.id;
	Util::copy(points, b.points);
	Util::copy(set, b.set);
	Util::copy(liberties, b.liberties);
}

void Block::clear() {
	points.Clear();
	set.Clear();
	liberties.Clear();
	id = -1;
	anchor = SG_NULLPOINT;
}

Block::~Block() {
	clear();
}
